package com.sgffsg.mygirl.controller;

import com.sgffsg.mygirl.properties.GirlProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 *
 * Created by work on 2017/9/23.
 */

@RestController
@RequestMapping("/hello")
public class HelloController {

    @Autowired
    private GirlProperties girlProperties;

//    @Value("${cupSize}")
//    private String cupSize;
//
//    @Value("${age}")
//    private int age;
//
//    @Value("${content}")
//    private String content;

    @GetMapping(value = "/say")
    public String say(@RequestParam(value = "id",required = false,defaultValue = "0") Integer myId){
        return "id="+myId;
    }

//    @RequestMapping(value = "/say",method = RequestMethod.GET)
//    public String say(@RequestParam(value = "id",required = false,defaultValue = "0") Integer myId){
//        return "id="+myId;
//    }

//    @RequestMapping(value = "/say",method = RequestMethod.GET)
//    public String say(@RequestParam("id") Integer myId){
//        return "id="+myId;
//    }

//    @RequestMapping(value = {"/say/{id}"},method = RequestMethod.GET)
//    public String say(@PathVariable("id") Integer id){
//        return "id="+id;
//    }

//    @RequestMapping(value = {"hello","hi"},method = RequestMethod.GET)
//    public String say(){
//        return "cupSize="+cupSize+",age="+age;
//        return girlProperties.getCupSize();
//    }
}
